package MemoryManager;

import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;

public class Processinfo {
    private final IntegerProperty PID = new SimpleIntegerProperty();
    private final IntegerProperty Status = new SimpleIntegerProperty();
    private final IntegerProperty Time = new SimpleIntegerProperty();
    private final IntegerProperty OccupyA = new SimpleIntegerProperty();
    private final IntegerProperty OccupyB = new SimpleIntegerProperty();
    private final IntegerProperty OccupyC = new SimpleIntegerProperty();

    // public IntegerProperty PIDProperty(){
    //     return PID;
    // }

    // public IntegerProperty StatusProperty(){
    //     return Status;
    // }

    // public IntegerProperty Time(){
    //     return Time;
    // }

    public Integer getPID(){
        return PID.getValue();
    }

    public String getStatus() {
        if (Status.getValue() == 0) {
            return "BLOCK";
        } else {
            return "READY/RUNNING";
        }
    }

    public Integer getTime(){
        return Time.getValue();
    }

    public Integer getOccupyA() {
        return OccupyA.getValue();
    }

    public Integer getOccupyB() {
        return OccupyB.getValue();
    }

    public Integer getOccupyC() {
        return OccupyC.getValue();
    }

    public Processinfo(Process process, Memory mem){
        this.PID.set(process.getPID());
        this.Status.set(process.getProcessState());;
        this.Time.set(mem.getTime());
        this.OccupyA.set(process.getA());
        this.OccupyB.set(process.getB());
        this.OccupyC.set(process.getC());
    }
}
